cmake_minimum_required(VERSION 3.6.0)
project(qt_ipc_demo)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets DBus REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets Quick DBus REQUIRED)

set(PROJECT_SOURCES
    fcitxdbustypes.h
    fcitxdbustypes.cpp
    fcitxcontrollerproxy.h
    fcitxdbusprovider.h
    fcitxdbusprovider.cpp
    inputmethodlistmodel.h
    inputmethodlistmodel.cpp
    # searchinputmethodmodel.h
    # searchinputmethodmodel.cpp
    test.h
)

add_executable(${PROJECT_NAME} main.cpp ${PROJECT_SOURCES})

target_link_libraries(${PROJECT_NAME}
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Widgets
    Qt${QT_VERSION_MAJOR}::Quick
    Qt${QT_VERSION_MAJOR}::Gui
    Qt${QT_VERSION_MAJOR}::DBus
)